<?php
namespace App\Http\Forms;

use App\Library\OSS;
use Kris\LaravelFormBuilder\Form;

class UnlockGoodForm extends Form
{
    public function buildForm()
    {
        $this
            ->add('type', 'select', [
                'label' => "解锁商品种类",
                'rules' => "required|string",
                'choices' => [
                    'package' => '套系商品',
                    'good' => '普通商品',
                ],
            ])
            ->add('unlock_good_id', 'linkage', [
                'label' => "解锁商品",
                'rules' => 'required|string',
                'attr' => ['class' => "form-control select2"],
                'url' => route('admin.search_type_good'),
                'choices' => [],
                'power' => "type",
            ])
            ->add('money', 'text', [
                'label' => '解锁金额',
                'rules' => 'required|integer|min:0|max:9999999',
            ])
            ->add('submit', 'submit', [
                'attr' => ['class' => "form-control btn btn-success"],
                'label' => '保存',
            ]);
    }
}
